<template>
    <!-- 预算管理 年度预算 审核 -->
    <div class="kshenhet">
        <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="num" label="单号">
            </el-table-column>
            <el-table-column prop="year" label="年度" sortable>
            </el-table-column>
            <el-table-column prop="name" label="预算树名称">
            </el-table-column>
            <el-table-column prop="people" label="编制人">
            </el-table-column>
            <el-table-column prop="date" label="操作日期" sortable>
            </el-table-column>
            <el-table-column prop="tag" label="状态" width="100" :filters="[{ text: '已审核', value: '已审核' }, { text: '待审核', value: '待审核' }]" :filter-method="filterTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                    <el-tag :type="scope.row.message === '已审核' ? 'primary' : 'success'" close-transition>{{scope.row.message}}</el-tag>
                </template>
            </el-table-column>
            <el-table-column label="查看">
                <template slot-scope="scope">
                    <el-button size="small" @click="handleEdit(scope.$index, scope.row)">查看</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>
<script>
export default {
    name: 'shenhet',
    data() {
        return {
            tableData: [{
                num: '1111',
                year: '2015',
                name: '2017-财务部',
                people: '11',
                date: '2016/12/15 15:21',
                message: '已审核',
            }, {
                num: '2222',
                year: '2016',
                name: '2017-财务部',
                people: '22',
                date: '2016/05/15 15:21',
                message: '已审核',
            }, {
                num: '555',
                year: '2017',
                name: '2017-财务部',
                people: '33',
                date: '2015/12/15 15:21',
                message: '待审核',
            }]
        }
    },
    methods: {
        formatter(row, column) {
            return row.address;
        },
        filterTag(value, row) {
            return row.message === value;
        },
        handleEdit(index, row) {
            console.log(index, row);
        }
    }
}
</script>
<style scoped>

</style>
